# -*- coding:utf8 -*-
from scrapy.http import Request


class PopFilterRequest(Request):
    def __init__(self, url, *args, **kwargs):
        super(PopFilterRequest, self).__init__(url=url, *args, **kwargs)
        self.meta["pop_filter"] = True

    @classmethod
    def from_request(cls, request):
        req = request.copy()
        req.meta["pop_filter"] = True
        return req

